public class FndKthNumber {

    public static int getNumber(int n,int m,int k){
        int left=1;
        int right=n*m;
        while (left<right){
            int mid=left+(right-left)/2;
            int res=0;
            for (int i = 1; i <=n ; i++) {
                res+=Math.min(mid/i,m);
            }
            if(res<k){
                left=mid+1;
            }else{
                right=mid;
            }
        }
        return left;
    }

    public static void main(String[] args) {
        System.out.println(getNumber(3,1,3));
    }
}
